

package ejb.ebank.entities;


import java.io.Serializable;

import javax.persistence.*;



/**
 * klasa reprezentujaca konto bakowe
 * @author piotrek
 */

@Entity
public class Account implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 6116380081346153029L;
	
	private long id;
	private BankClient bankClient;
	private double accountBalance;
	private String accountNumber;
	private long fxiId;
	private long statusId;
	private BankCard bankCard;
	private double debet;
	private String pass;
	
	
	public Account() {
		// default
	}
	
	public Account(BankClient client) {
		this.bankClient = client;
	}
	
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public long getId() {
		return this.id;
	}
	
	public void setId(long ancId) {
		this.id = ancId;
	}
	
	@ManyToOne(cascade={CascadeType.ALL})
	@JoinColumn(name="BankClient_Id")
	public BankClient getBankClient() {
		return this.bankClient;
	}
	
	public void setBankClient(BankClient client) {
		this.bankClient = client;
	}
	
	
	public double getAccountBalance() {
		return accountBalance;
	}
	
	public void setAccountBalance(double accountBalance) {
		this.accountBalance = accountBalance;
	}
	

	public String getAccountNumber() {
		return accountNumber;
	}
	
	public void setAccountNumber(String accountNumber) {
		this.accountNumber = accountNumber;
	}
	

	public long getFxiId() {
		return fxiId;
	}
	
	public void setFxiId(long fxiId) {
		this.fxiId = fxiId;
	}
	

	public long getStatusId() {
		return statusId;
	}
	
	public void setStatusId(long statusId) {
		this.statusId = statusId;
	}
	

	@OneToOne(cascade={CascadeType.ALL})
	@JoinColumn(name="BankCard_Id")
	public BankCard getBankCard() {
		return this.bankCard;
	}
	
	public void setBankCard(BankCard card) {
		this.bankCard = card;
	}
	

	public double getDebet() {
		return debet;
	}
	
	public void setDebet(double debet) {
		this.debet = debet;
	}
	

	public String getPass() {
		return pass;
	}
	
	public void setPass(String pass) {
		this.pass = pass;
	}

}
